<?php
header("content-type:text/html;charset=utf-8");
$link=mysqli_connect('localhost','root','','my_database');
if(!$link){
    exit("数据库连接错误：".mysqli_connect_error());

}
//设置字符集
if(!mysqli_set_charset($link,'utf8')){
    exit("数据库库字符集设置错误".mysqli_error($link));
}
//测试
echo"链接成功";

?>
<h1>11refgretfgr1</h1>